﻿Imports System.ComponentModel
Imports BUS
Imports DTO

Public Class ucNhatKyHeThong
    'System.Environment.MachineName lay ten may
    Private dsNhatKyHT As New BindingList(Of NhatKyDTO)
    Private Sub ucNhatKyHeThong_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        dsNhatKyHT = HeThongBUS.layDSHeThong(DateTime.Now.ToShortDateString(), DateTime.Now.ToShortDateString())
        gridCtrlNhatKy.DataSource = dsNhatKyHT
        dateTuNgay.EditValue = DateTime.Now.ToShortDateString
        dataDenNgay.EditValue = DateTime.Now.ToShortDateString
    End Sub

    Private Sub btnXem_Click(sender As Object, e As EventArgs) Handles btnXem.Click
        HeThongBUS.themNhatKy(frmMain.maND, "Nhật Ký Hệ Thống", "Xem", "")
        Dim tuNgay As DateTime = DateTime.Parse(dateTuNgay.EditValue.ToString())
        Dim denNgay As DateTime = DateTime.Parse(dataDenNgay.EditValue.ToString())
        dsNhatKyHT = HeThongBUS.layDSHeThong(tuNgay.ToShortDateString(), denNgay.ToShortDateString())
        gridCtrlNhatKy.DataSource = dsNhatKyHT
    End Sub

End Class
